<template>
  <a-drawer
    title="博士考生入学考试报名登记表"
    wrapClassName="fullscreen"
    height="100%"
    placement="bottom"
    :closable="false"
    @close="onClose"
    :visible="confirmHandleVisiable" >
    <div>
        <a-form :form="form" >
      <a-row :gutter="48" style="width:100%">
          <a-col :md="18" :sm="24">
                <a-col :lg="8" :md="12" :sm="24">
                    <a-form-item
                        label="考生姓名"
                    >
                        <a-input  v-decorator="[
                        'ksxm',
                        {
                            rules: [{ required: true, message: '请输入考生姓名!' }],
                        }
                        ]" :disabled="disabledStop" />
                    </a-form-item>
                </a-col>
                <a-col :lg="8" :md="12" :sm="24">
                    <a-form-item
                        label="报名号"
                    >
                    <a-input  v-decorator="[
                        'ksbmh',
                        {
                            rules: [{ required: true, message: '请输入报名号!' }],
                        }
                        ]" :disabled="disabledStop" />
                        </a-form-item>
                </a-col>
                <a-col :lg="8" :md="12" :sm="24">
                    <a-form-item
                        label="姓名拼音"
                    >
                        <a-input  v-decorator="[
                        'xmpy',
                        {
                            rules: [{ required: true, message: '请输入姓名拼音!' }],
                        }
                        ]" :disabled="disabledStop" />
                    </a-form-item>
                </a-col>
                <!-- <a-col :lg="8" :md="12" :sm="24">
                    <a-form-item
                        label="导师是否在岗"
                    >
                        <a-select v-decorator="['sfzg',
                        {
                            rules: [{ required: true, message: '请选择导师是否在岗!' }],
                        }]" :disabled="disabledStop" >
                        <a-select-option v-for="i in TYPE0321" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
                        </a-select>
                    </a-form-item>
                </a-col> -->
                <a-col :lg="8" :md="12" :sm="24">
                    <a-form-item
                        label="性别"
                    >
                        <a-select v-decorator="['xbm',
                        {
                            rules: [{ required: true, message: '请选择性别!' }],
                        }]" :disabled="disabledStop" >
                        <a-select-option v-for="i in TYPE0011" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
                        </a-select>
                    </a-form-item>
                </a-col>
                <a-col :lg="8" :md="12" :sm="24">
                    <a-form-item
                        label="民族"
                    >
                        <a-select v-decorator="['mzm',
                        {
                            rules: [{ required: true, message: '请选择民族!' }],
                        }]" :disabled="disabledStop" >
                        <a-select-option v-for="i in TYPE0017" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
                        </a-select>
                    </a-form-item>
                </a-col>
                <a-col :lg="8" :md="12" :sm="24">
                    <a-form-item
                        label="出生日期"
                    >
                    <a-date-picker v-decorator="['csrq',
                        {
                            rules: [{ required: true, message: '请选择出生日期!' }],
                        }]" :disabled="disabledStop"/>
                    </a-form-item>
                </a-col>

                <a-col :lg="8" :md="12" :sm="24">
                    <a-form-item
                        label="婚否"
                    >
                        <a-select v-decorator="['hyzkm',
                        {
                            rules: [{ required: true, message: '请选择婚否!' }],
                        }]" :disabled="disabledStop" >
                        <a-select-option v-for="i in TYPE0410" :key="i.code" :value="String(i.code)">{{ i.name }}</a-select-option>
                        </a-select>
                    </a-form-item>
                </a-col>
                <a-col :lg="8" :md="12" :sm="24">
                    <a-form-item
                        label="证件类型"
                    >
                        <a-select v-decorator="['sfzjlxm',
                        {
                            rules: [{ required: true, message: '请选择证件类型!' }],
                        }]" :disabled="disabledStop" >
                        <a-select-option v-for="i in TYPE0405" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
                        </a-select>
                    </a-form-item>
                </a-col>
                <a-col :lg="8" :md="12" :sm="24">
                    <a-form-item
                        label="证件号"
                    >
                        <a-input  v-decorator="[
                        'zjhm',
                        {
                            rules: [{ required: true, message: '请输入证件号!' }],
                        }
                        ]" :disabled="disabledStop" />
                    </a-form-item>
                </a-col>
                <a-col :lg="8" :md="12" :sm="24">
                    <a-form-item
                        label="政治面貌"
                    >
                        <a-select v-decorator="['zzmmm',
                        {
                            rules: [{ required: true, message: '请选择政治面貌!' }],
                        }]" :disabled="disabledStop" >
                        <a-select-option v-for="i in TYPE0020" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
                        </a-select>
                    </a-form-item>
                </a-col>
                <a-col :lg="8" :md="12" :sm="24">
                    <a-form-item
                        label="现役军人"
                    >
                        <a-select v-decorator="['sfxyjr',
                        {
                            rules: [{ required: true, message: '请选择现役军人!' }],
                        }]" :disabled="disabledStop" >
                        <a-select-option v-for="i in TYPE0406" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
                        </a-select>
                    </a-form-item>
                </a-col>
                <a-col :lg="8" :md="12" :sm="24">
                    <a-form-item
                        label="考生档案所在单位邮政编码"
                    >
                        <a-input  v-decorator="[
                        'daszdwyb',
                        {
                            rules: [{ required: true, message: '请输入考生档案所在单位邮政编码!' }],
                        }
                        ]" :disabled="disabledStop" />
                    </a-form-item>
                </a-col>
                <a-col :lg="8" :md="12" :sm="24">
                    <a-form-item
                        label="现学习或工作单位"
                    >
                        <a-input  v-decorator="[
                        'xzgzdw',
                        {
                            rules: [{ required: true, message: '请输入现学习或工作单位!' }],
                        }
                        ]" :disabled="disabledStop" />
                    </a-form-item>
                </a-col>
                <a-col :lg="8" :md="12" :sm="24">
                    <a-form-item
                        label="现学习或工作单位性质"
                    >
                        <a-select v-decorator="['xzgzdwxzm',
                        {
                            rules: [{ required: true, message: '请选择现学习或工作单位性质!' }],
                        }]" :disabled="disabledStop" >
                        <a-select-option v-for="i in TYPE0066" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
                        </a-select>
                    </a-form-item>
                </a-col>
                <a-col :lg="8" :md="12" :sm="24">
                    <a-form-item
                        label="考生来源"
                    >
                        <a-select v-decorator="['kslym',
                        {
                            rules: [{ required: true, message: '请选择考生来源!' }],
                        }]" :disabled="disabledStop" >
                        <a-select-option v-for="i in TYPE0407" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
                        </a-select>
                    </a-form-item>
                </a-col>
                <a-col :lg="8" :md="8" :sm="24">
                    <a-form-item
                        label="考生档案所在单位"
                    >
                        <a-input  v-decorator="[
                        'daszdw',
                        {
                            rules: [{ required: true, message: '请输入考生档案所在单位!' }],
                        }
                        ]" :disabled="disabledStop" />
                    </a-form-item>
                </a-col>
                <a-col :lg="16" :md="16" :sm="24">
                    <a-form-item
                        label="档案所在单位地址"
                    >
                        <a-input  v-decorator="[
                        'daszdwdz',
                        {
                            rules: [{ required: true, message: '请输入档案所在单位地址!' }],
                        }
                        ]" :disabled="disabledStop" />
                    </a-form-item>
                </a-col>
                <a-col :lg="16" :md="16" :sm="24">
                    <a-form-item
                        label="本科毕业单位"
                    >
                    <a-row :gutter="0">
                        <a-col :md="12" :sm="12">
                            <a-select v-decorator="['hxsxwdwszsf']" :disabled="disabledStop" @change="bkbydwChange" showSearch :allowClear="true">
                                <a-select-option v-for="i in selectMenu.sf" :key="i.areaCode" :value="i.areaCode">{{ i.name }}</a-select-option>
                            </a-select>
                        </a-col>
                        <a-col :md="12" :sm="12">
                            <a-select showSearch labelInValue v-decorator="['bkbyxxdm',{initValue:''}]" :disabled="disabledStop" :allowClear="true">
                            <a-select-option v-for="i in bkbydw" :key="i.xxdm" :value="i.xxdm">{{ i.xxmc }}</a-select-option>
                            </a-select>
                        </a-col>
                    </a-row>
                    </a-form-item>
                </a-col>
               
                <a-col :lg="8" :md="8" :sm="24">
                    <a-form-item
                        label="本科毕业专业代码"
                    >
                        <a-input  v-decorator="[
                        'bkbyzym'
                        ]" :disabled="disabledStop" />
                    </a-form-item>
                </a-col>
                <a-col :lg="8" :md="8" :sm="24">
                    <a-form-item
                        label="本科毕业专业"
                    >
                        <a-input  v-decorator="[
                        'bkbyzy'
                        ]" :disabled="disabledStop" />
                    </a-form-item>
                </a-col>
                <a-col :lg="8" :md="12" :sm="24">
                    <a-form-item
                        label="获得本科证书形式"
                    >
                        <a-select v-decorator="['hbkzsxxxsm']" :disabled="disabledStop" :allowClear="true">
                        <a-select-option v-for="i in TYPE0388" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
                        </a-select>
                    </a-form-item>
                </a-col>
                <a-col :lg="8" :md="12" :sm="24">
                    <a-form-item
                        label="本科毕业年月"
                    >
                    <a-month-picker v-decorator="['bkbyny']" :disabled="disabledStop"/>
                    </a-form-item>
                </a-col>
                <a-col :lg="8" :md="12" :sm="24">
                    <a-form-item
                        label="本科毕业证书编号"
                    >
                        <a-input  v-decorator="[
                        'bkbyzsbh'
                        ]" :disabled="disabledStop" />
                    </a-form-item>
                </a-col>
                <a-col :lg="16" :md="16" :sm="24">
                    <a-form-item
                        label="获学士学位单位"
                    >
                    <a-row :gutter="0">
                        <a-col :md="12" :sm="12">
                            <a-select v-decorator="['hxsxwdwszsf']" disabled @change="xsxwdwChange" showSearch :allowClear="true">
                            <a-select-option v-for="i in selectMenu.sf" :key="i.areaCode" :value="i.areaCode">{{ i.name }}</a-select-option>
                            </a-select>
                        </a-col>
                        <a-col :md="12" :sm="12">
                            <a-select labelInValue v-decorator="['hxsxwdwdm']" :disabled="disabledStop" showSearch>
                            <a-select-option v-for="i in xsxwdw" :key="i.xxdm" :value="i.xxdm">{{ i.xxmc }}</a-select-option>
                            </a-select>
                        </a-col>
                    </a-row>
                    </a-form-item>
                </a-col>

                <a-col :lg="8" :md="8" :sm="24">
                    <a-form-item
                        label="获学士学位专业代码"
                    >
                        <a-input  v-decorator="[
                        'hxsxwzydm'
                        ]" :disabled="disabledStop" />
                    </a-form-item>
                </a-col>
                <a-col :lg="8" :md="8" :sm="24">
                    <a-form-item
                        label="获学士学位专业"
                    >
                        <a-input  v-decorator="[
                        'hxsxwzymc'
                        ]" :disabled="disabledStop" />
                    </a-form-item>
                </a-col>
                 <a-col :lg="16" :md="16" :sm="24">
                    <a-form-item
                        label="获学士学位年月"
                    >
                    <a-month-picker v-decorator="['hxsxwny']" :disabled="disabledStop"/>
                    </a-form-item>
                </a-col>
                <a-col :lg="8" :md="8" :sm="24">
                    <a-form-item
                        label="获学士学位证书编号"
                    >
                        <a-input  v-decorator="[
                        'xsxwzsbh'
                        ]" :disabled="disabledStop" />
                    </a-form-item>
                </a-col>
                <a-col :lg="16" :md="16" :sm="24">
                    <a-form-item
                        label="硕士毕业单位"
                    >
                    <a-row :gutter="0">
                        <a-col :md="12" :sm="12">
                            <a-select v-decorator="['hssxwdwszsf']" :disabled="disabledStop" @change="ssbyddChange" showSearch :allowClear="true">
                            <a-select-option v-for="i in selectMenu.sf" :key="i.areaCode" :value="i.areaCode">{{ i.name }}</a-select-option>
                            </a-select>
                        </a-col>
                        <a-col :md="12" :sm="12">
                            <a-select labelInValue v-decorator="['ssbyxxdm',
                            {
                                rules: [{ required: false, message: '请选择硕士毕业单位!' }],
                            },{initValue:''}]" :disabled="disabledStop" showSearch>
                            <a-select-option v-for="i in ssbydd" :key="i.xxdm" :value="i.xxdm">{{ i.xxmc }}</a-select-option>
                            </a-select>
                        </a-col>
                    </a-row>
                    </a-form-item>
                </a-col><a-col :lg="8" :md="8" :sm="24">
                    <a-form-item
                        label="硕士毕业专业代码"
                    >
                        <a-input  v-decorator="[
                        'ssbyzym',
                        {
                            rules: [{message: '硕士毕业专业代码长度为6!',len:6 }],
                        },
                        ]" :disabled="disabledStop" />
                    </a-form-item>
                </a-col>
                <a-col :lg="8" :md="8" :sm="24">
                    <a-form-item
                        label="硕士毕业专业"
                    >
                        <a-input  v-decorator="[
                        'ssbyzy'
                        ]" :disabled="disabledStop" />
                    </a-form-item>
                </a-col>
                 <a-col :lg="16" :md="16" :sm="24">
                    <a-form-item
                        label="硕士毕业年月"
                    >
                    <a-month-picker v-decorator="['ssbyny'
                        ]" :disabled="disabledStop"/>
                    </a-form-item>
                </a-col>
               
                
                <a-col :lg="8" :md="8" :sm="24">
                    <a-form-item
                        label="硕士毕业证书编号"
                    >
                        <a-input  v-decorator="[
                        'ssbyzsbh'
                        ]" :disabled="disabledStop" />
                    </a-form-item>
                </a-col>
                <a-col :lg="16" :md="16" :sm="24">
                    <a-form-item
                        label="获硕士学位单位"
                    >
                    <a-row :gutter="0">
                        <a-col :md="12" :sm="12">
                            <a-select showSearch v-decorator="['hssxwdwszsf']" disabled  @change="ssxwddChange" :allowClear="true">
                            <a-select-option v-for="i in selectMenu.sf" :key="i.areaCode" :value="i.areaCode">{{ i.name }}</a-select-option>
                            </a-select>
                        </a-col>
                        <a-col :md="12" :sm="12">
                            <a-select showSearch labelInValue v-decorator="['hssxwdwdm',
                           {initValue:''}]" :disabled="disabledStop">
                            <a-select-option v-for="i in ssxwdd" :key="i.xxdm" :value="i.xxdm">{{ i.xxmc }}</a-select-option>
                            </a-select>
                        </a-col>
                    </a-row>
                    </a-form-item>
                </a-col>
                <a-col :lg="8" :md="8" :sm="24">
                    <a-form-item
                        label="获硕士学位专业代码"
                    >

                        <a-input  v-decorator="[
                        'ssxwzydm',
                        {
                            rules: [{message: '获硕士学位专业代码长度为6!',len:6 }],
                        },
                        ]" :disabled="disabledStop" />
                    </a-form-item>
                </a-col>
                <a-col :lg="8" :md="8" :sm="24">
                    <a-form-item
                        label="获硕士学位专业"
                    >

                        <a-input  v-decorator="[
                        'ssxwzymc'
                        ]" :disabled="disabledStop" />
                    </a-form-item>
                </a-col>
                <a-col :lg="8" :md="8" :sm="24">
                    <a-form-item
                        label="获得硕士学位方式"
                    >
                        <a-select v-decorator="['hssxwfsm'
                       ]" :disabled="disabledStop" :allowClear="true">
                        <a-select-option v-for="i in TYPE0408" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
                        </a-select>
                    </a-form-item>
                </a-col>
                <a-col :lg="8" :md="8" :sm="24">
                    <a-form-item
                        label="获硕士毕业年月"
                    >
                    <a-month-picker v-decorator="['hssxwny']" :disabled="disabledStop"/>
                    </a-form-item>
                </a-col>
                <a-col :lg="8" :md="8" :sm="24">
                    <a-form-item
                        label="硕士学位证书编号"
                    >
                        <a-input  v-decorator="[
                        'ssxwzsbh'
                        ]" :disabled="disabledStop" />
                    </a-form-item>
                </a-col>
                
                <a-col :lg="8" :md="12" :sm="24">
                    <a-form-item
                        label="最后学历"
                    >
                        <a-select v-decorator="['zhxlm',
                        {
                            rules: [{ required: true, message: '请选择最后学历!' }],
                        }]" :disabled="disabledStop" >
                        <a-select-option v-for="i in selectMenu.xw" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
                        </a-select>
                    </a-form-item>
                </a-col>
                <a-col :lg="8" :md="12" :sm="24">
                    <a-form-item
                        label="最后学位"
                    >
                        <a-select v-decorator="['zhxwm',
                        {
                            rules: [{ required: true, message: '请选择最后学位!' }],
                        }]" :disabled="disabledStop" >
                        <a-select-option v-for="i in selectMenu.xl" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
                        </a-select>
                    </a-form-item>
                </a-col>
                <a-col :lg="24" :md="24" :sm="24">
                    <a-alert class="card" style="margin-bottom:0" message="※注意：1，直博生学位应为  无；硕博连读最后学位应为XX学士学位；公开招考/申请考核制最后学位应为XX硕士学位；境外学历应选择境外学位；2，直博生最后学历只能为本科及以下，硕博连读的考生，最后学历只能为大学本科生" banner />
                    </a-col>
                <a-col :lg="8" :md="8" :sm="24">
                    <a-form-item
                        label="注册学号"
                    >
                        <a-input  v-decorator="[
                        'zcxh',
                        {
                            rules: [{ required: numCheck, message: '请输入注册学号!' }],
                        }
                        ]" :disabled="disabledStop" />
                    </a-form-item>
                </a-col>
               
                <a-col :lg="8" :md="12" :sm="24">
                    <a-form-item
                        label="报考类别"
                    >
                        <a-select v-decorator="['bklbm',
                        {
                            rules: [{ required: true, message: '请选择报考类别!' }],
                        }]" :disabled="disabledStop" @change = 'lbChange'>
                        <a-select-option v-for="i in TYPE0394" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
                        </a-select>
                    </a-form-item>
                </a-col>
                <a-col :lg="8" :md="12" :sm="24">
                    <a-form-item
                        label="定向单位名称"
                    >
                        <a-input  v-decorator="[
                        'dxwpdwmc',
                        {
                            rules: [{ required: dsCheck, message: '请输入定向单位名称!' }],
                        }
                        ]" :disabled="disabledStop || dsAble" />
                    </a-form-item>
                </a-col>
                <a-col :lg="8" :md="12" :sm="24">
                    <a-form-item
                        label="专项计划"
                    >
                        <a-select v-decorator="['zxjh',
                        {
                            rules: [{ required: true, message: '请选择专项计划!' }],
                        }]" :disabled="disabledStop" >
                        <a-select-option v-for="i in ZXJHBSZS" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
                        </a-select>
                    </a-form-item>
                </a-col>
                <a-col :lg="8" :md="12" :sm="24">
                    <a-form-item
                        label="考试方式"
                    >
                        <a-select v-decorator="['bsksfsm',
                        {
                            rules: [{ required: true, message: '请选择考试方式!' }],
                        }]" :disabled="disabledStop" @change="ksfsChange">
                        <a-select-option v-for="i in TYPE0389" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
                        </a-select>
                    </a-form-item>
                </a-col>
                <a-col :lg="8" :md="12" :sm="24">
                    <a-form-item
                        label="报考院系"
                    >
                        <a-select labelInValue v-decorator="['bkyxsm',
                        {
                            rules: [{ required: true, message: '请选择报考院系!' }],
                        },{initValue:''}]" :disabled="disabledStop" @change='yxChange'>
                            <a-select-option v-for="i in selectMenu.bkyx" :key="i.id" :value="i.dwh">{{ i.dwmc }}</a-select-option>
                        </a-select>
                    </a-form-item>
                </a-col>
                <a-col :lg="8" :md="12" :sm="24">
                    <a-form-item
                        label="报考专业"
                    >
                        <a-select labelInValue v-decorator="['bkzydm',
                        {
                            rules: [{ required: true, message: '请选择报考专业!' }],
                        },{initValue:''}]" :disabled="disabledStop" @change="zyChange">
                        <a-select-option v-for="i in selectMenu.bkzydm" :key="i.zyh" :value="i.zyh">{{ i.zymc }}</a-select-option>
                        </a-select>
                    </a-form-item>
                </a-col>
                <a-col :lg="8" :md="12" :sm="24">
                    <a-form-item
                        label="研究方向"
                    >
                        <a-select labelInValue v-decorator="['bkyjfxm',
                        {
                            rules: [{ required: true, message: '请选择研究方向!' }],
                        },{initValue:''}]" :disabled="disabledStop" @change="yjfxChange">
                        <a-select-option v-for="i in selectMenu.bkfx" :key="i.yjfxm" :value="i.yjfxm">{{ i.yjfxm.substring(i.yjfxm.length-2) +"-"+ i.yjfxmc }}</a-select-option>
                        </a-select>
                    </a-form-item>
                </a-col>
                 <a-col :lg="16" :md="16" :sm="24">
                    <a-form-item
                        label="报考导师"
                    >
                        <a-select labelInValue v-decorator="['bkdsymId',
                        {
                            rules: [{ required: true, message: '请选择报考导师!' }],
                        },{initValue:''}]" :disabled="disabledStop" @change="dsChange">
                        <a-select-option v-for="i in selectMenu.ds" :key="i.id" :value="i.id">{{ i.xm }}</a-select-option>
                        </a-select>
                    </a-form-item>
                </a-col>
                 <a-col :lg="8" :md="12" :sm="24">
                    <a-form-item
                        label="外国语类型"
                    >
                        <a-select v-decorator="['wgylx',
                        {
                            rules: [{  message: '请选择外国语类型!' }],
                        },{initValue:''}]"  disabled>
                        <a-select-option v-for="i in selectMenu.wgy" :key="i.id" :value="i.id">{{ i.name }}</a-select-option>
                        </a-select>
                    </a-form-item>
                </a-col>
                <a-col :lg="8" :md="12" :sm="24">
                    <a-form-item
                        label="外国语名称"
                    >
                        <a-select labelInValue v-decorator="['wgym',
                        {
                            rules: [{ required: true, message: '请选择外国语名称!' }],
                        },{initValue:''}]" disabled >
                        <a-select-option v-for="i in selectMenu.wy" :key="i.kmbm" :value="i.kmbm">{{ i.kmmc }}</a-select-option>
                        </a-select>
                    </a-form-item>
                </a-col>
                <a-col :lg="8" :md="12" :sm="24">
                    <a-form-item
                        label="业务课一"
                    >
                        <a-select labelInValue v-decorator="['ywky',
                        {
                            rules: [{ required: true, message: '请选择业务课一!' }],
                        },{initValue:''}]" disabled >
                        <a-select-option v-for="i in selectMenu.yw1" :key="i.kmbm" :value="i.kmbm">{{ i.kmmc }}</a-select-option>
                        </a-select>
                    </a-form-item>
                </a-col>
                <a-col :lg="8" :md="12" :sm="24">
                    <a-form-item
                        label="业务课二"
                    >
                        <a-select labelInValue v-decorator="['ywke',
                        {
                            rules: [{ required: true, message: '请选择业务课二!' }],
                        },{initValue:''}]" disabled >
                        <a-select-option v-for="i in selectMenu.yw2" :key="i.kmbm" :value="i.kmbm">{{ i.kmmc }}</a-select-option>
                        </a-select>
                    </a-form-item>
                </a-col>
                <!-- <a-col :lg="24" :md="24" :sm="24">
                    <a-form-item
                        label="外国语是否免试"
                    >
                    <a-switch v-decorator="['wgysfms',{rules: [],}]" :defaultChecked="postParams.wgysfms == '0' ? false : true" :key="random" :disabled="disabledStop" @change="onChange"/>
                        已参加大学博士入学外语考试并且成绩合格，申请免试
                    </a-form-item>
                </a-col> -->
                
                <!-- <a-col :lg="16" :md="16" :sm="24">
                    <a-form-item
                        label="政治理论加试"
                    >
                    <a-switch :defaultChecked="postParams.jskmemc == 'false'? false : true" :disabled="disabledStop" :key="random" v-decorator="[
                        'jskmemc'
                        ]"/>
                        是否参加政治理论加试(如果无硕士学位则必选，否则不选)
                    </a-form-item>
                </a-col> -->
                <a-col :lg="8" :md="12" :sm="24">
                    <a-form-item
                        label="固定电话"
                    >
                        <a-input  v-decorator="[
                        'gddh'
                        ]" :disabled="disabledStop" />
                    </a-form-item>
                </a-col>
                <a-col :lg="8" :md="12" :sm="24">
                    <a-form-item
                        label="移动电话"
                    >
                        <a-input  v-decorator="[
                        'yddh',
                        {
                            rules: [{ required: true, message: '请输入移动电话!' }],
                        }
                        ]" :disabled="disabledStop" />
                    </a-form-item>
                </a-col>
                <a-col :lg="8" :md="12" :sm="24">
                    <a-form-item
                        label="电子邮件"
                    >
                        <a-input  v-decorator="[
                        'dzxx',
                        {
                            rules: [{ required: true, message: '请输入电子邮件!' }],
                        }
                        ]" :disabled="disabledStop" />
                    </a-form-item>
                </a-col>
                <a-col :lg="8" :md="12" :sm="24">
                    <a-form-item
                        label="通讯地址邮政编码"
                    >
                        <a-input  v-decorator="[
                        'yzbm',
                        {
                            rules: [{ required: true, message: '请输入通讯地址邮政编码!' }],
                        }
                        ]" :disabled="disabledStop" />
                    </a-form-item>
                </a-col>
                <a-col :lg="16" :md="24" :sm="24">
                    <a-form-item
                        label="考生通讯地址"
                    >
                        <a-input  v-decorator="[
                        'txdz',
                        {
                            rules: [{ required: true, message: '请输入考生通讯地址!' }],
                        }
                        ]" :disabled="disabledStop" />
                    </a-form-item>
                </a-col>
          </a-col>
          <a-col :md="6" :sm="24">
              <a-form-item
                label=""
              >
              <a-upload
                name="file"
                style="width:80%"
                listType="picture-card"
                class="avatar-uploader"
                :showUploadList="false"
                :action="photoUrl"
                :beforeUpload="beforeUpload"
                @change="handleChange"
                :customRequest="customUpload"
              >
                <input type="hidden" name="zpdz" :value="avaterId">
                <img class="avatar_img" v-if="imageUrl" :src="imageUrl" alt="avatar" />
                <div v-else>
                    <a-icon :type="loading ? 'loading' : 'plus'" />
                    <div class="ant-upload-text">Upload</div>
                </div>
              </a-upload>
            </a-form-item>
          </a-col>
          <!-- <a-col :md="24" :sm="24">

                <a-col :lg="12" :md="12" :sm="24">
                    <a-form-item
                        label="本校职工"
                    >
                        <a-switch v-decorator="['gzgx',{rules: []}]" :defaultChecked="postParams.gzgx == '01'?false:true" :disabled="disabledStop" :key="random" />
                        是否本校在职职工
                    </a-form-item>
                </a-col>
          </a-col> -->
      </a-row>
    </a-form>
    </div>
    <div class="drawer-bootom-button" style="z-index:1">
        <div style="float:left">
            <a-button type="primary" @click="onClose" >关闭窗口</a-button>
        </div>
        <div style="float:right">
            <a-button type="primary" @click="print">打印</a-button>
            <!-- <a-button type="primary" :disabled="moneyStatus == '1'">拍照</a-button> -->
            <a-button type="primary" :disabled="moneyStatus == '1' || isQuery" @click="moneyAffirm('1')">确认</a-button>
            <a-button type="primary" v-if="disabledStop" :disabled="moneyStatus == '1'" @click="handleEdit">编辑</a-button>
            <template v-else>
                <a-button @click="handleSave" type="primary" :loading="loading" :disabled="moneyStatus == '1'">保存</a-button>
                <a-button @click="handleCancel" type="primary" :disabled="moneyStatus == '1'">取消</a-button>
            </template>
            <a-button type="primary" v-if="moneyStatus == '1'" @click="moneyAffirm('0')">撤销确认</a-button>
        </div>
    </div>
  </a-drawer>
</template>

<script>
import moment from 'moment'
import { mapState } from 'vuex'
import { setTimeout } from 'timers';

const selectArr = ['TYPE0126', 'TYPE0075', 'TYPE0125', 'TYPE0072','TYPE0394','TYPE0389','TYPE0407','TYPE0396','TYPE0066','TYPE0011','TYPE0410','TYPE0017','TYPE0114','TYPE0024','TYPE0409','TYPE0023','TYPE0020','TYPE0393','TYPE0307','TYPE0408','TYPE0388','TYPE0011','TYPE0405','TYPE0406','ZXJHBSZS']

function getBase64 (img, callback) {
  const reader = new FileReader()
  reader.addEventListener('load', () => callback(reader.result))
  reader.readAsDataURL(img)
}

export default {
  props: {
    confirmHandleVisiable: {
      default: false
    },
    info: {
      default: () => ({})
    }
  },
  data () {
    return {
      checkNick:'',
      bhCheck:'',
      numCheck:true,
      id:'',
      loading: false,
      dsAble:'',
      dsCheck:'',
      zbCheck:'',
      postParams: {},
      imageUrl: '',
      random:'',
      selectMenu: {
        bkyx: [], // 院系
        bkzydm: [] ,//专业
        bkyjfx: [], //研究方向
        sf: [], // 省份
        wy: [], // 外语
        yw1: [], // 业务一
        yw2: [], // 业务二
        ds:[],
        xw:[],
        xl:[],
        ms:[
            {
            code:'0',
            name:'否'
            },
            {
            code:'1',
            name:'是'
        }],
        xl:[
            {
            code:'0',
            name:'否'
            },
            {
            code:'1',
            name:'是'
            }
        ],
        wgy:[
            {
                id:'2',
                name:'考试'
            },
            {
                id:'3',
                name:'免试'
            }
        ]
      },
      photoUrl:`${process.env.SERVICE_URL}upload/img`,
      moneyStatus: "1", // 缴费状态
      disabledStop: true,
      allColleges: [], // 所有专业
      bkbydw: [], // 本科毕业单位 - 学校
      xsxwdw: [], // 获学士学位单位 - 学校
      ssbydd: [], // 硕士毕业单位 - 学校
      ssxwdd: [], // 获硕士学位单位 - 学校
      avaterId: '', // 图片地址
      doctoralAdmissionYear:'',
      infm:'',
      isQuery:true
    }
  },
  beforeCreate () {
    this.form = this.$form.createForm(this)
  },
  computed: {
    ...mapState({
      systemInfo: state => state.app.systemInfo,
      TYPE0321: state => state.app['TYPE0321'], // 是否在岗
      TYPE0126: state => state.app['TYPE0126'], // 年级
      TYPE0394: state => state.app['TYPE0394'], // 博士报考类型
      TYPE0389: state => state.app['TYPE0389'], // 考试方式
      TYPE0407: state => state.app['TYPE0407'], // 考生来源(博士招生)
      TYPE0396: state => state.app['TYPE0396'], // 录取后档案和工作关
      TYPE0066: state => state.app['TYPE0066'], // 社会单位性质代码
      TYPE0011: state => state.app['TYPE0011'], // 性别
      TYPE0410: state => state.app['TYPE0410'], // 婚姻
      TYPE0017: state => state.app['TYPE0017'], // 民族
      TYPE0114: state => state.app['TYPE0114'], // 外国语码
      TYPE0024: state => state.app['TYPE0024'], // 语种熟练程度和外语考试等级代码
      TYPE0409: state => state.app['TYPE0409'], // 最后学历码(博士招生)
      TYPE0023: state => state.app['TYPE0023'], // 最后学位码(硕士招生)
      TYPE0020: state => state.app['TYPE0020'], // 政治面貌代码
      TYPE0393: state => state.app['TYPE0393'], // 何种外语资格证明
      TYPE0388: state => state.app['TYPE0388'], // 获得本科证书形式
      TYPE0408: state => state.app['TYPE0408'], // 获得硕士学位方式
      TYPE0011: state => state.app['TYPE0011'], // 性别
      TYPE0405: state => state.app['TYPE0405'], // 证件类型
      TYPE0406: state => state.app['TYPE0406'], // 现役军人
      ZXJHBSZS: state => state.app['ZXJHBSZS'], // 现役军人
    })
  },
  watch: {
    info (val) {
        
        this.isQuery = true
        this.random=Math.random()
        console.log(this.random)
         this.$set(this.postParams,'wgysfms','')
         this.$set(this.postParams,'jskmemc','')
         this.$set(this.postParams,'gzgx','')
        // this.postParams.wgysfms='1'
        this.postParams = this.info

        this.disabledStop=true;
        // this.postParams = {...this.postParams,...this.info}
        console.log('info:',this.info)
        console.log('postParams:',this.postParams)
        this.moneyStatus = this.info.qrzt
        function fillZero(str) {
            if(str.length&&str.length==1) {
                return '0'+str
            }else{
                return str
            }
        }

        this.$nextTick(() => {
           
            this.form.resetFields();
            this.id=val.id;
            this.imageUrl=process.env.IMG_URL+val.zpdz
            this.avaterId=val.zpdz
            this.form.setFieldsValue({'ksxm': val.ksxm})  // 考生姓名
            this.form.setFieldsValue({'xmpy': val.xmpy})  // 姓名拼音
            this.form.setFieldsValue({'mzm': val.mzm})  // 民族sfzjlxm
            this.form.setFieldsValue({'sfzjlxm': val.sfzjlxm})  // 证件类型
            this.form.setFieldsValue({'xbm': val.xbm})  // 性别
            this.form.setFieldsValue({'sfxyjr': val.sfxyjr})  // 现役军人
            this.form.setFieldsValue({'csrq': val.csrq})  // 出生日期
            this.form.setFieldsValue({'hyzkm': val.hyzkm})  // 婚否
            this.form.setFieldsValue({'zjhm': val.zjhm})  // 证件号
             this.form.setFieldsValue({'ksbmh': val.ksbmh})  // 证件号
            this.form.setFieldsValue({'zzmmm': val.zzmmm})  // 政治面貌
            this.form.setFieldsValue({'daszdwyb': val.daszdwyb})  // 考生档案所在单位邮政编码
            this.form.setFieldsValue({'xzgzdw': val.xzgzdw})  // 现学习或工作单位
            this.form.setFieldsValue({'xzgzdwxzm': val.xzgzdwxzm})  // 现学习或工作单位性质
            this.form.setFieldsValue({'kslym': val.kslym})  // 考生来源
            this.form.setFieldsValue({'daszdw': val.daszdw})  // 考生档案所在单位
            this.form.setFieldsValue({'daszdwdz': val.daszdwdz})  // 档案所在单位地址
            this.form.setFieldsValue({'hxsxwdwszsf': val.hxsxwdwszsf})  // 本科毕业单位
            this.form.setFieldsValue({'dasfzr':val.dasfzr})//录取后档案和工资关系
            this.form.setFieldsValue({'zxjh':val.zxjh})//
            this.form.setFieldsValue({'bkbydm':val.bkbydm})//
            this.form.setFieldsValue({'ssxwzydm':val.ssxwzydm})//
            if(!this.form.getFieldValue('bkbyxxdm')){
                this.form.setFieldsValue({'bkbyxxdm':{key: val.bkbyxxdm,label: val.bkbyxxmc}})
            }
            this.form.setFieldsValue({'bkbyzy': val.bkbyzy})  // 本科毕业专业
             this.form.setFieldsValue({'bkbyzym':val.bkbyzym})
            this.form.setFieldsValue({'hbkzsxxxsm': val.hbkzsxxxsm}) // 获得本科证书形式
            this.form.setFieldsValue({'bkbyny': val.bkbyny})  // 本科毕业年月
            this.form.setFieldsValue({'bkbyzsbh': val.bkbyzsbh})  // 本科毕业证书编号
            this.form.setFieldsValue({'hxsxwdwszsf2': val.hxsxwdwszsf})  // 获学士学位单位
            if(!this.form.getFieldValue('hxsxwdwdm')){
                this.form.setFieldsValue({'hxsxwdwdm':{key: val.hxsxwdwdm,label: val.hxsxwdwmc}})
            }
           this.form.setFieldsValue({'ssxwzymc': val.ssxwzymc})  // 获学士学位专业

                this.form.setFieldsValue({'hxsxwzydm':val.hxsxwzydm})
            this.form.setFieldsValue({'hxsxwzymc':val.hxsxwzymc})


            this.form.setFieldsValue({'hxsxwny': val.hxsxwny})  // 获学士学位年月
            this.form.setFieldsValue({'xsxwzsbh': val.xsxwzsbh})  // 获学士学位证书编号
            this.form.setFieldsValue({'hssxwdwszsf': val.hssxwdwszsf})  // 硕士毕业单位
            if(!this.form.getFieldValue('ssbyxxdm')){
                this.form.setFieldsValue({'ssbyxxdm':{key: val.ssbyxxdm,label: val.ssbyxxmc}})
            }
            this.form.setFieldsValue({'ssbyzy': val.ssbyzy})  // 硕士毕业专业
            this.form.setFieldsValue({'ssbyzym': val.ssbyzym})  // 硕士毕业专业

            this.form.setFieldsValue({'ssbyny': val.ssbyny})  // 硕士毕业年月
            this.form.setFieldsValue({'ssbyzsbh': val.ssbyzsbh})  // 硕士毕业证书编号
            this.form.setFieldsValue({'hssxwdwszsf': val.hssxwdwszsf})  // 获硕士学位单位
            if(!this.form.getFieldValue('hssxwdwdm')){
                this.form.setFieldsValue({'hssxwdwdm':{key: val.hssxwdwdm,label: val.hssxwdwmc}})
            }
            this.form.setFieldsValue({'hssxwzymc': val.hssxwzymc})  // 获硕士学位专业
            this.form.setFieldsValue({'hssxwzydm': val.hssxwzydm})  // 获硕士学位专业
			 // if(!this.form.getFieldValue('hssxwzydm')){
    //             this.form.setFieldsValue({'hssxwzydm':{key: val.hssxwzydm,label: this.getZymc(val.hssxwzydm)}})
    //         }

            this.form.setFieldsValue({'hssxwfsm': val.hssxwfsm}) // 获得硕士学位方式
            this.form.setFieldsValue({'hssxwny': val.hssxwny})  // 获硕士毕业年月
            this.form.setFieldsValue({'ssxwzsbh': val.ssxwzsbh})  // 硕士学位证书编号
            this.form.setFieldsValue({'zhxlm': val.zhxlm})  // 最后学历
            this.form.setFieldsValue({'zhxwm': val.zhxwm})  // 最后学位
            this.form.setFieldsValue({'zcxh': val.zcxh})  // 注册学号
            this.form.setFieldsValue({'bklbm': val.bklbm})  // 报考类别
            if(val.bklbm == '11'){
                this.dsAble = true
                this.dsCheck = false
            }else {
                this.dsAble = false
                this.dsCheck = true
            }
            this.form.setFieldsValue({'bsksfsm': val.bsksfsm})  // 考试方式
            if(val.bsksfsm == '66' || val.bsksfsm == '23' || val.bsksfsm == '24'){
                this.numCheck = true
            }else{
                this.numCheck = false
            }
            if(val.bsksfsm == '66'){
                this.zbCheck = false
            }else {
                this.zbCheck = true
            }
            this.selectMenu.xw = []
            this.selectMenu.xl = []
            if(val.bsksfsm == '11'){
                this.TYPE0409.forEach(item => {
                    if(item.code!= '4'){
                        this.selectMenu.xw.push(item)
                    }
                });
                this.TYPE0023.forEach(item =>{
                    if(item.code.substr(0, 1)=='3'){
                        this.selectMenu.xl.push(item)
                    }
                })
                 this.TYPE0023.forEach(item =>{
                    if(item.code == '000' || item.code == '900'){
                        this.selectMenu.xl.push(item)
                    }
                })
            }else if(val.bsksfsm == '23'){
                this.TYPE0409.forEach(item => {
                    if(item.code=='3'){
                        this.selectMenu.xw.push(item)
                    }
                });
                this.TYPE0023.forEach(item =>{
                    if(item.code.substr(0, 1)=='4'){
                        this.selectMenu.xl.push(item)
                    }
                })
                 this.TYPE0023.forEach(item =>{
                    if(item.code == '900'){
                        this.selectMenu.xl.push(item)
                    }
                })
            }else if(val.bsksfsm == '66'){
                this.TYPE0409.forEach(item => {
                    if(item.code=='4'){
                        this.selectMenu.xw.push(item)
                    }
                });
                this.TYPE0023.forEach(item =>{
                    if(item.code == '000'){
                        this.selectMenu.xl.push(item)
                    }
                })
            }else if(val.bsksfsm == '99'){
                this.TYPE0409.forEach(item => {
                        this.selectMenu.xw.push(item)
                });
                this.TYPE0023.forEach(item =>{
                    if(item.code.substr(0, 1)=='3'){
                        this.selectMenu.xl.push(item)
                    }
                })
                 this.TYPE0023.forEach(item =>{
                    if(item.code == '900'){
                        this.selectMenu.xl.push(item)
                    }
                })
            }
            //  if(val.gzgx =='01'){
            //     this.info.gzgx =false
            // }else{
            //     this.info.gzgx =true
            // }
            // this.form.getFieldDecorator('gzgx',{initialValue:val.gzgx})  // 录取后档案和工资关系
            console.log(val.gzgx)
            // 报考院系
            if(!this.form.getFieldValue('bkdsymId')){
                this.form.setFieldsValue({'bkdsymId':{key: val.bkdsymId,label: val.bkdsyxm}})
            }

            // 报考院系
            if(!this.form.getFieldValue('bkyxsm')){
                // this.form.getFieldDecorator('bkyxsm',{initialValue: val.bkyxsm})
               this.form.setFieldsValue({'bkyxsm':{key: val.bkyxsm,label: val.bkyxsmc}})
            }
            // 报考专业
            if(!this.form.getFieldValue('bkzydm')){
                this.form.setFieldsValue({'bkzydm':{key: val.bkzydm,label: val.bkzymc}})
            }
            // 研究方向
            if(!this.form.getFieldValue('bkyjfxm')){
                this.form.setFieldsValue({'bkyjfxm':{key: val.bkyjfxm,label: val.bkyjfxmc}})
            }
            // 外国语名称
            if(!this.form.getFieldValue('wgym')){
                this.form.setFieldsValue({'wgym':{key: val.wgym,label: val.wgymc}})
            }
            // 业务课一
            if(!this.form.getFieldValue('ywky')){
                this.form.setFieldsValue({'ywky':{key: val.ywkym,label: val.ywkymc}})
            }
            // 业务课二
            if(!this.form.getFieldValue('ywke')){
                this.form.setFieldsValue({'ywke':{key: val.ywkem,label: val.ywkemc}})
            }
            this.form.setFieldsValue({'kswyspm': val.kswyspm})  // 有何种外语资格证明
            this.form.setFieldsValue({'wyzgzsbh': val.wyzgzsbh})  // 外语资格证书编号
            val.wgysfms=val.wgysfms?val.wgysfms:'0'
            console.log(val.wgysfms)
             this.form.setFieldsValue({'wgysfms': val.wgysfms})  // 外国语是否免试
             val.wgysfsm=='0'?this.checkNick=true:this.checkNick=false
            //     this.$nextTick(() => {
            //     this.form.validateFields(['kswyspm'], { force: true });
            //     this.form.validateFields(['wyzgzsbh'], { force: true });
            // });
            val.sfwtdxl=val.sfwtdxl?val.sfwtdxl:'0'
             this.form.setFieldsValue({'sfwtdxl': val.sfwtdxl})
            // this.form.getFieldDecorator('wgysfms', {initialValue: val.wgysfms})
            this.form.setFieldsValue({'dxwpdwmc': val.dxwpdwmc})  // 定向单位名称
            // this.form.setFieldsValue({'wyzgzsbh': val.wyzgzsbh})  // 政治理论加试
            this.form.setFieldsValue({'gddh': val.gddh})  // 固定电话
            this.form.setFieldsValue({'yddh': val.yddh})  // 移动电话
            this.form.setFieldsValue({'dzxx': val.dzxx})  // 电子信箱
            this.form.setFieldsValue({'yzbm': val.yzbm})  // 通讯地址邮政编码
            this.form.setFieldsValue({'txdz': val.txdz})  // 考生通讯地址
            this.form.setFieldsValue({'wgylx':val.wgylx})
                // this.form.setFieldsValue({'bkdsymId': val.bkdsymId})	  // 报考导师
            // this.form.setFieldsValue({'wyzgzsbh': val.wyzgzsbh})  // 本校职工
         let params ={ssyxm: this.form.getFieldValue('bkyxsm').key,
          sszym: this.form.getFieldValue('bkzydm').key,
          yjfxm: this.form.getFieldValue('bkyjfxm').key,
          dsxxId: this.form.getFieldValue('bkdsymId').key
          }
      this.$api.base.getForeign(params).then(res =>{
          if(res.data){
          this.selectMenu.wy = res.data['01']
          this.selectMenu.yw1 = res.data['0201']
          this.selectMenu.yw2 = res.data['0202']
          }
      })

            this.getProssion(val.bkyxsm)
            this.getDirec(val.bkzydm)
            this.getClasses({key: val.bkyjfxm,label: val.ywkemc})
            this.getTeachers(val.bkyjfxm)
            // this.bkbydwChange(val.hxsxwdwszsf)
            // this.xsxwdwChange(val.hxsxwdwszsf)
            // this.ssbyddChange(val.hssxwdwszsf)
            // this.ssxwddChange(val.hssxwdwszsf)
            this.$api.base.schoolInfoQueryAll({
                xzqhsdm: val.hxsxwdwszsf
            }).then(res => {
                this.bkbydw = res.data
                this.xsxwdw = res.data
            })
            this.$api.base.schoolInfoQueryAll({
                xzqhsdm: val.hssxwdwszsf
            }).then(res => {
                this.ssbydd = res.data
                this.ssxwdd = res.data
            })

        })

    }
  },
  created () {
    this.initSelectMenu()
    selectArr.forEach(v => {
      this.$store.dispatch('app/setDictionary', v)
    })
  },
  methods: {
	getZymc(zym){
		var zy_ = this.allColleges.find(e=>{
				return e.zyh===zym;
			});
		return zy_ && zy_.zymc ? zy_.zymc:zym;
	},
    initSelectMenu () {
      let allRequest = [
        this.$api.base.collegeAll(),
        this.$api.base.areaList(),
      ]
      Promise.all(allRequest).then(res => {
        this.selectMenu.bkyx = res[0].data;
        console.log(this.selectMenu.bkyx)
        this.selectMenu.sf = res[1].data.map(item => {
            item.areaCode = item.areaCode + ''
            return item
        })

      })
      this.$api.base.getSchoolYear().then(res=>{
        this.doctoralAdmissionYear=res.data.doctoralAdmissionYear;
      })
      // 全部专业
      this.$api.base.getAllCollege().then(res=>{
        this.allColleges = res.data;
      })

    },
    // 选择院系
    yxChange (code, option) {
      console.log(code)
    //   this.form.setFieldsValue({'ssyxm':''})
      this.form.setFieldsValue({'bkzydm':''})
      this.form.setFieldsValue({'bkyjfxm':''})
      this.form.setFieldsValue({'wgym':''})
      this.form.setFieldsValue({'ywky':''})
      this.form.setFieldsValue({'ywke':''})
       this.form.setFieldsValue({'bkdsymId':''})
      this.getProssion(code.key)
      // 获取导师
      // this.getTeachers(code.key)

    },
    ksfsChange(code){
        this.selectMenu.xw= []
        this.selectMenu.xl=[]
        this.form.setFieldsValue({'zhxlm':''})
      this.form.setFieldsValue({'zhxwm':''})
       if(code == '22' || code == '23'){
           this.numCheck = true
       }else{
           this.numCheck = false
       }
       this.$nextTick(() => {
        this.form.validateFields(['zcxh'], { force: true });
      });
       if(code == '66'){
                this.zbCheck = false
            }else {
                this.zbCheck = true
            }
    this.$nextTick(() => {
        this.form.validateFields(['xsxwzsbh'], { force: true });
        this.form.validateFields(['hxsxwny'], { force: true });
      });
      if(code == '11'){
                this.TYPE0409.forEach(item => {
                    if(item.code!= '4'){
                        this.selectMenu.xw.push(item)
                    }
                });
                this.TYPE0023.forEach(item =>{
                    if(item.code.substr(0, 1)=='3'){
                        this.selectMenu.xl.push(item)
                    }
                })
                this.TYPE0023.forEach(item =>{
                    if(item.code == '000' || item.code == '900'){
                        this.selectMenu.xl.push(item)
                    }
                })
            }else if(code == '23'){
                this.TYPE0409.forEach(item => {
                    if(item.code=='3'){
                        this.selectMenu.xw.push(item)
                    }
                });
                this.TYPE0023.forEach(item =>{
                    if(item.code.substr(0, 1)=='4'){
                        this.selectMenu.xl.push(item)
                    }
                })
                this.TYPE0023.forEach(item =>{
                    if(item.code == '900'){
                        this.selectMenu.xl.push(item)
                    }
                })
            }else if(code== '66'){
                this.TYPE0409.forEach(item => {
                    if(item.code=='4'){
                        this.selectMenu.xw.push(item)
                    }
                });
                this.TYPE0023.forEach(item =>{
                    if(item.code == '000'){
                        this.selectMenu.xl.push(item)
                    }
                })
            }else if(code == '99'){
                this.TYPE0409.forEach(item => {
                        this.selectMenu.xw.push(item)
                });
                this.TYPE0023.forEach(item =>{
                    if(item.code.substr(0, 1)=='3'){
                        this.selectMenu.xl.push(item)
                    }
                })
                 this.TYPE0023.forEach(item =>{
                    if(item.code == '900'){
                        this.selectMenu.xl.push(item)
                    }
                })
            }
    },
    lbChange(code){
       if(code == '11'){
           this.dsAble = true
           this.dsCheck =false
       }else{
        this.dsAble = false
        this.dsCheck = true
       }
       this.$nextTick(() => {
        this.form.validateFields(['dxwpdwmc'], { force: true });
      });
    },
    //外国语是否免试
    msChange(code){
        console.log(code)
        if(code==1){
            this.checkNick=true

        }else{
            this.checkNick=false

        }
      this.$nextTick(() => {
        this.form.validateFields(['kswyspm'], { force: true });
        this.form.validateFields(['wyzgzsbh'], { force: true });
      });

      this.$forceUpdate();
    },
    // 获取专业
    getProssion(code){
      // 获取专业
      this.$api.base.majorAll({
        lsdwh: code
      }).then(res => {
        this.$set(this.selectMenu, 'bkzydm', res.data)
      })
    },
    // 选择专业
    zyChange(code){
      console.log(code)
      this.form.setFieldsValue({'bkyjfxm':''})
      this.form.setFieldsValue({'wgym':''})
      this.form.setFieldsValue({'ywky':''})
      this.form.setFieldsValue({'ywke':''})
       this.form.setFieldsValue({'bkdsymId':''})
      this.getDirec(code.key)
    },
    // 获取研究方向
    getDirec(code){
      this.$api.base.researchAll({
        xwccm: 3,
        zsxn: this.doctoralAdmissionYear,
        ssyxm: this.form.getFieldValue('bkyxsm').key,
        sszym: code
      }).then(res => {
        this.$set(this.selectMenu, 'bkfx', res.data)
      })
    },
    // 选择研究方向
    yjfxChange(code) {
      console.log(code)
      this.form.setFieldsValue({'wgym':''})
      this.form.setFieldsValue({'ywky':''})
      this.form.setFieldsValue({'ywke':''})
       this.form.setFieldsValue({'bkyjfxm':''})
       this.form.setFieldsValue({'bkds':''})
       this.form.setFieldsValue({'bkdsymId':''})
      this.getClasses(code)
      this.getTeachers(code.key)
    },
    // 获取外语和业务课数据
    getClasses(code) {
        // 获取业务课和外语课
      this.$api.doctorRecruit.admissionsClasses({
          yjfxm: code.key,
          ssyxm: this.form.getFieldValue('bkyxsm').key,
          sszym: this.form.getFieldValue('bkzydm').key
      }).then(res=>{
        this.selectMenu.wy = res.data['01']
        this.selectMenu.yw1 = res.data['0201']
        this.selectMenu.yw2 = res.data['0202']
      })
    },
    dsChange(code){
        this.form.setFieldsValue({'wgym':{key: "",label: ""}})
        this.form.setFieldsValue({'ywky':{key: "",label: ""}})
        this.form.setFieldsValue({'ywke':{key: "",label: ""}})
        let params ={ssyxm: this.form.getFieldValue('bkyxsm').key,
          sszym: this.form.getFieldValue('bkzydm').key,
          yjfxm: this.form.getFieldValue('bkyjfxm').key,
          dsxxId: code.key
          }

      this.$api.base.getForeign(params).then(res =>{

          this.selectMenu.wy = res.data['01']
          this.form.setFieldsValue({'wgym':{key: this.selectMenu.wy[0].kmbm,label: this.selectMenu.wy[0].kmmc}})
        this.selectMenu.yw1 = res.data['0201']
         this.form.setFieldsValue({'ywky':{key: this.selectMenu.yw1[0].kmbm,label: this.selectMenu.yw1[0].kmmc}})
        this.selectMenu.yw2 = res.data['0202']
         this.form.setFieldsValue({'ywke':{key: this.selectMenu.yw2[0].kmbm,label: this.selectMenu.yw2[0].kmmc}})
      })
    },
    getTeachers(code){
        let params={
            ssyxm:this.form.getFieldValue('bkyxsm').key,
            zym:this.form.getFieldValue('bkzydm').key,
            yjfxm:code,
            zsxn:this.doctoralAdmissionYear
        }
        this.$api.base.getGuide(params).then(res =>{
            this.$set(this.selectMenu,'ds',res.data)
        })
    },
    // 本科毕业单位
    bkbydwChange (code) {
        console.log('code:',code)
        this.form.setFieldsValue({'hxsxwdwdm':''})
        this.form.setFieldsValue({'bkbyxxdm':''})
        this.$api.base.schoolInfoQueryAll({
            xzqhsdm: code
        }).then(res => {
            this.bkbydw = res.data
            this.xsxwdw = res.data
        })
    },
    // 获学士学位单位
    xsxwdwChange (code) {
        console.log('code:',code)
        this.form.setFieldsValue({'hxsxwdwdm':''})

        this.$api.base.schoolInfoQueryAll({
            xzqhsdm: code
        }).then(res => {
            this.xsxwdw = res.data
        })
    },
    // 硕士毕业单位
    ssbyddChange (code) {
        console.log('code:',code)
        this.form.setFieldsValue({'ssbyxxdm':''})
        this.form.setFieldsValue({'hssxwdwdm':''})
        this.$api.base.schoolInfoQueryAll({
            xzqhsdm: code
        }).then(res => {
            this.ssbydd = res.data
            this.ssxwdd = res.data
        })
    },
    // 获硕士学位单位
    ssxwddChange (code) {
        console.log('code:',code)
        this.form.setFieldsValue({'hssxwdwdm':''})

        this.$api.base.schoolInfoQueryAll({
            xzqhsdm: code
        }).then(res => {
            this.ssxwdd = res.data
        })
    },
    // 关闭
    onClose () {
      this.$emit('close')
    },
    print() {
      // 导出
      console.log('导出')
      this.$export('admissions/bsksbmxx/exportPersonal', {id: this.info.id})

    },
    // 保存
    handleSubmit () {
      this.form.validateFields((err, values) => {
        if (err) {

        } else {
          this.$emit('success')
        }
      })
    },
    handleDelete (key) {
      const dataSource = [...this.data]
      this.data = dataSource.filter(item => item.key !== key)
    },
    // 改变时间
    handleDateChange () {
    },
    handleChange (info) {
      if (info.file.status === 'uploading') {
        this.loading = true
        console.log(info)
        return
      }
      if (info.file.status === 'done') {
        // Get this url from response in real world.
        getBase64(info.file.originFileObj, (imageUrl) => {
          this.imageUrl = imageUrl
          this.loading = false
        })
      }
    },
    customUpload (info) {
        let file = info.file;
        let param = new FormData(); //创建form对象
        param.append('file',file);//通过append向form对象添加数据
        console.log(param.get('file')); //FormData私有类对象访问不到，可以通过get判断值是否传进去

        var url = this.photoUrl
        console.log(url)
        this.$upload(url,param).then(res => {
            // console.log('res:',res)
            this.avaterId = res.data[0]

            const reader = new FileReader();
            // 读取文件内容，结果用data:url的字符串形式表示
            reader.readAsDataURL(file);
            reader.onload = (e) => {
                // console.log(e.target.result);  // 上传的图片的编码
                this.imageUrl = e.target.result
                this.loading = false
            }

        })
    },
    beforeUpload (file) {
      const isJPG = file.type === 'image/jpeg'
      if (!isJPG) {
        this.$message.error('You can only upload JPG file!')
      }
      const isLt2M = file.size / 1024 / 1024 < 2
      if (!isLt2M) {
        this.$message.error('Image must smaller than 2MB!')
      }
      return isJPG && isLt2M
    },
    onChange(code){
        console.log(code)
    },
    handleCancel () {
       this.form.resetFields()
       this.$api.doctorRecruit.admissionsId(this.id).then( res => {
        console.log('res:',res)
        this.info = res.data

      })
    },
    handleEdit () {
      this.disabledStop = false
      this.isQuery = true
    },
    // 缴费确认
    moneyAffirm(status) {
        var params = {
            id: this.info.id,
            qrzt: status,
        }

        this.$confirm({
            title: '提示',
            content: `确定${status=='0'?'撤销确认':'现场确认'}吗？`,
            okText: '确认',
            cancelText: '取消',
            onOk:() => {
                this.$api.doctorRecruit.admissionsAffirm(params).then(res => {
                    // this.reset()
                    console.log(res)
                    if(status=='0'){
                        this.$message.success('撤销成功')
                    }else{
                    this.$message.success('确认成功')
                    }
                    this.$emit('success')
                    this.moneyStatus == '0'?(this.moneyStatus = '1'):(this.moneyStatus = '0')
                    console.log(this.moneyStatus)
                }).finally(() => {
                    // this.loadingBtn = false
                }).catch(function(reason) {
                    console.log('catch:', reason);
                });
            },
            onCancel:() => {},
        });

    },
    // 保存
    handleSave () {
      // this.$emit('success', this.postParams)
      this.form.validateFields( (err,values) => {
    //         console.log('values:',values)
        if(err){
          this.$message.error("请选择必填项")
        }else{
            var params = Object.assign({},this.postParams)
            console.log(this.avaterId)
            // 处理values数据，
            values.id = this.info.id
            values.zpdz = this.avaterId
            this.$DateToString(values)
            // if(values.bkbyny ){
            // values.bkbyny = moment(values.bkbyny).format('YYYY-MM')
            // }
            // if(values.csrq){
            // values.csrq = moment(values.csrq).format('YYYY-MM-DD')
            // }
            // if(values.hssxwny){
            // values.hssxwny = moment(values.hssxwny).format('YYYY-MM')
            // }
            // if(values.hxsxwny){
            // values.hxsxwny = moment(values.hxsxwny).format('YYYY-MM')
            // }
            // if(values.ssbyny){
            // values.ssbyny = moment(values.ssbyny).format('YYYY-MM')
            // }

            values.bkbyxxmc = values.bkbyxxdm.label
            values.bkbyxxdm = values.bkbyxxdm.key

			//本科毕业专业
			// values.bkbyzy = values.bkbyzym.label
   //          values.bkbyzym = values.bkbyzym.key

            values.bkyjfxmc = values.bkyjfxm.label
            values.bkyjfxm = values.bkyjfxm.key
            values.bkyxsmc = values.bkyxsm.label
            values.bkyxsm = values.bkyxsm.key
            values.bkzymc = values.bkzydm.label
            values.bkzydm = values.bkzydm.key

            values.hssxwdwmc = values.hssxwdwdm.label
            values.hssxwdwdm = values.hssxwdwdm.key

			//硕士专业hxsxwzydm
			// values.hxsxwzymc = values.hxsxwzydm.label
   //          values.hxsxwzydm = values.hxsxwzydm.key

            // values.ssbyzy = values.ssbyzym.label
            // values.ssbyzym = values.ssbyzym.key

			 // 获硕士学位专业
			// values.hssxwzymc = values.hssxwzydm.label
   //          values.hssxwzydm = values.hssxwzydm.key

            values.hxsxwdwmc = values.hxsxwdwdm.label
            values.hxsxwdwdm = values.hxsxwdwdm.key
            values.ssbyxxmc = values.ssbyxxdm.label
            values.ssbyxxdm = values.ssbyxxdm.key
            values.wgymc = values.wgym.label
            values.wgym = values.wgym.key
            values.ywkemc = values.ywke.label
            values.ywkem = values.ywke.key
            values.ywkymc = values.ywky.label
            values.ywkym = values.ywky.key
            values.bkdsyxm  =values.bkdsymId.label
            values.bkdsymId=values.bkdsymId.key
            values.jskmemc=values.jskmemc

            console.log(values.bkdsyxm )
            values.dasfzr=values.dasfzr
            delete values.ywky
            delete values.ywke

            this.$api.doctorRecruit.admissionsSave(values).then(res => {
                // this.reset()
                console.log(res)
              this.isQuery = false
                this.$emit('success')
            }).finally(() => {
                this.loadingBtn = false
                this.disabledStop = true
            }).catch(function(reason) {
                console.log('catch:', reason);
            });
         }
       })


     }

  }
}
</script>

<style lang="less">
.fullscreen{
    .ant-drawer-wrapper-body{
        height: 100%;
        overflow: auto;
    }
    /deep/ .avatar_img{
        width: 100px;
        max-height: 120px;
        object-fit: contain;
    }
}
</style>
